package pers.jason.wppm.api.entity.auth;

import com.fasterxml.jackson.annotation.JsonView;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

/**
 * 系统用户
 * @author Jason
 * @Date 2018-10-24 17:59
 *
 * 数据库交互对象
 * 
 */
public class User implements Serializable{
	
	/*
	 * 基础信息
	 */
	public interface UserSimpleInfo{}
	
	/*
	 * 详细信息
	 */
	public interface UserDetails extends UserSimpleInfo{}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
	private String userId;
	
	private String loginName;
	
	private String userName;
	
	private Boolean gender;
	
	private String headImg;
	
	private Date birthday;
	
	private String email;
	
	private String mobile;
	
	private String password;

	private Boolean accountNonExpired;

	private Boolean accountNonLocked;

	private Boolean credentialsNonExpired;

	private Boolean enable;

	private Boolean emailPublic;

	private Boolean mobilePublic;

	private Date lastLoginTime;

	private Date createTime;

	private Set<Role> roles;

	@JsonView(UserSimpleInfo.class)
	public String getUserId() {
		return userId;
	}

	@JsonView(UserSimpleInfo.class)
	public String getLoginName() {
		return loginName;
	}

	@JsonView(UserSimpleInfo.class)
	public String getUserName() {
		return userName;
	}

	@JsonView(UserSimpleInfo.class)
	public Boolean getGender() {
		return gender;
	}

	@JsonView(UserSimpleInfo.class)
	public String getHeadImg() {
		return headImg;
	}

	@JsonView(UserSimpleInfo.class)
	public Date getBirthday() {
		return birthday;
	}

	@JsonView(UserSimpleInfo.class)
	public String getEmail() {
		return email;
	}

	@JsonView(UserSimpleInfo.class)
	public String getMobile() {
		return mobile;
	}

	@JsonView(UserSimpleInfo.class)
	public String getPassword() {
		return password;
	}

	@JsonView(UserSimpleInfo.class)
	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	@JsonView(UserSimpleInfo.class)
	public Set<Role> getRoles() {
		return roles;
	}

	@JsonView(UserSimpleInfo.class)
	public Boolean getEmailPublic() {
		return emailPublic;
	}

	@JsonView(UserSimpleInfo.class)
	public Boolean getMobilePublic() {
		return mobilePublic;
	}

	@JsonView(UserDetails.class)
	public Boolean getAccountNonExpired() {
		return accountNonExpired;
	}

	@JsonView(UserDetails.class)
	public Boolean getAccountNonLocked() {
		return accountNonLocked;
	}

	@JsonView(UserDetails.class)
	public Boolean getCredentialsNonExpired() {
		return credentialsNonExpired;
	}

	@JsonView(UserDetails.class)
	public Boolean getEnable() {
		return enable;
	}

	@JsonView(UserDetails.class)
	public Date getCreateTime() {
		return createTime;
	}


	public User() {
		super();
	}

	public User(String userId, String loginName, String userName, Boolean gender, String headImg) {
		super();
		this.userId = userId;
		this.loginName = loginName;
		this.userName = userName;
		this.gender = gender;
		this.headImg = headImg;
	}

	public User(String loginName, String userName, Boolean gender, String headImg) {
		super();
		this.loginName = loginName;
		this.userName = userName;
		this.gender = gender;
		this.headImg = headImg;
	}

	@Override
	public String toString() {
		return "User [userId=" + userId + ", loginName=" + loginName + ", userName=" + userName + ", gender=" + gender
				+ ", headImg=" + headImg + ", birthday=" + birthday + ", email=" + email + ", mobile=" + mobile
				+ ", password=" + password + ", isAccountNonExpired=" + accountNonExpired + ", isAccountNonLocked="
				+ accountNonLocked + ", isCredentialsNonExpired=" + credentialsNonExpired + ", isEnable=" + enable
				+ ", isEmailPublic=" + emailPublic + ", isMobilePublic=" + mobilePublic + ", lastLoginTime="
				+ lastLoginTime + ", createTime=" + createTime + "]";
	}


	public void setUserId(String userId) {
		this.userId = userId;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public void setGender(Boolean gender) {
		this.gender = gender;
	}

	public void setHeadImg(String headImg) {
		this.headImg = headImg;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setAccountNonExpired(Boolean accountNonExpired) {
		this.accountNonExpired = accountNonExpired;
	}

	public void setAccountNonLocked(Boolean accountNonLocked) {
		this.accountNonLocked = accountNonLocked;
	}

	public void setCredentialsNonExpired(Boolean credentialsNonExpired) {
		this.credentialsNonExpired = credentialsNonExpired;
	}

	public void setEnable(Boolean enable) {
		this.enable = enable;
	}

	public void setEmailPublic(Boolean emailPublic) {
		this.emailPublic = emailPublic;
	}

	public void setMobilePublic(Boolean mobilePublic) {
		this.mobilePublic = mobilePublic;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}
}
